package ch.fusun.baron.player;

import ch.fusun.baron.core.injection.Inject;
import ch.fusun.baron.data.DataUpdate;
import ch.fusun.baron.player.api.PlayerService;

/**
 *
 */
public class AddPlayerToDynastyDataUpdate implements DataUpdate {
	@Inject
	private transient PlayerService playerService;
	private Dynasty dynasty;
	private Player child;

	/**
	 * Kryo
	 */
	public AddPlayerToDynastyDataUpdate() {
	}

	/**
	 * @param dynasty
	 *            The dynasty
	 * @param child
	 *            The new player
	 */
	public AddPlayerToDynastyDataUpdate(Dynasty dynasty, Player child) {
		this.dynasty = dynasty;
		this.child = child;
	}

	@Override
	public void update() {
		playerService.addPlayerToDynasty(dynasty, child);
	}

}
